vcApplication
vcApplication is the object type for the main application, thereby granting access to the application's GUI, commands and other common properties.
See in: Overview
Module: vcCore
Parent: -
Children -
Referenced by: vcCore.getApplication()
Properties
Learn how to use properties here. The properties are also inherited from the parent class.
| Name | Type | Access | Description |
| ContextManager | vcContextManager | R | A container that provides access to vcContext objects in the application and possibility to change active one. |
| LayerManager | vcLayerManager | R | A container that provides access to vcLayer objects currently present and possibility to create new ones. |
| LayoutVisualizationSettings | vcLayoutVisualizationSettings | R | Gets the application wide default visualization settings used for sub-layouts without customized settings. |
| LocalizationService | vcLocalizationService | R | Gets the localization service. |
| Materials | vcList[vcMaterial] | R | Gets a list of all materials in the application. |
| MaxRecursionDepth | Integer | RW | Gets or sets maximum recursion depth.See moreNote that this affects VC API recursion depth which is different from Python's recursion limit. Use caution when changing the value as it may result in unexpected behavior. Exceptions: ValueError: When given value is smaller than 10 or current recursion depth. |
| MessageService | vcMessageService | R | Gets the message service used to add messages, clear messages, and handle message scopes. |
| PdfRecorder | vcPdfRecorder | R | Gets the PDF Recorder. Every instance of vcPdfRecorder control the same global PDF recorder. |
| RobotSelectionService | vcRobotSelectionService | R | Gets the Robot Selection Service. |
| SelectionManager | vcSelectionManager | R | Gets the Selection Manager. |
| SnapService | vcSnapService | R | Gets the Snap Service. |
| TopologyPickService | vcTopologyPickService | R | Topology pick service provides options for handling the selection and creation of points, lines, and curves using the interactiveTopologyPick command.. |
| VideoRecorder | vcVideoRecorder | R | Gets the Video Recorder. Every instance of vcVideoRecorder controls the same global video recorder. |
| WorldManager | vcWorldManager | R | Gets the simulation world manager. Only available for scripts that are not tied to a specific world, like application commands. See moreFor other scripts, use getWorld(). Exceptions: RuntimeError: When the calling script is not allowed to access other worlds than its owner. " |
Methods
Learn how to use methods here. The methods are also inherited from the parent class.
| Name | Return Type | Parameters | Description |
| createMaterial | vcMaterial | String name | Creates a new material with a given name.See moreIt also registers the material with the application. Parameters: name (str): The name of the material. Exceptions: RuntimeError: When a material with the same name already exists. Returns: vcMaterial: The material. |
| executeActionItem | tuple | String itemId | Executes a .NET ActionItem object. Given arguments will be used as values for the properties passed to ActionItem.Execute(PropertyCollection args) method.See moreActionItem may return data back by updating values of these properties and therefore all property values are provided as a return value. Parameters: itemId (str): Action item id. args (*args): Variable length argument list. Exceptions: ValueError: When no action item with the given id is found. TypeError: When any of the given argument types is not supported. Returns: tuple: Contains values for properties passed to the action item. See itemId's |
| findMaterial | vcMaterial | String name | Finds the material matching the given name.See moreIf no material is found then None is returned. Parameters: name (str): The name of the material. Returns: vcMaterial or None: The material. |
| loadVCMX | vcNode | String uri | Loads the contents of a VCMX file into the 3D world.See moreNote: In most cases, the file URI scheme is file:/// followed by the full path to file. Parameters: uri (str): The file path or URI of the .vcmx file to load. Returns: If loading is successful, returns the component; otherwise returns None. |
| render | None | None | Renders the scene of 3D world. |
| saveVCMX | None | String uri, Boolean includecomponents | Saves the contents of 3D world as a layout using a given uri.See moreParameters: uri (str): The file path or URI where the .vcmx file will be saved. includecomponents (bool): Defines if the components are included in the layout. Exceptions: RuntimeError: If the save operation fails. |
Events
Learn how to use events here. The events are also inherited from the parent class.
| Name | Parameters | Description |
| OnRender | vcSimulation simulation | Triggered when the application renders a scene in 3D world. Parameters: simulation (vcSimulation): The rendered simulation. |
Example: Find Component From World
"""Finding a component is done via vcWorld in py3 api. This example shows how to find a component by its name in the world. """ import vcCore as vc world = vc.getWorld() found_comp = world.findComponent("MyCustomComponent") print (found_comp.Name)